﻿using System;
using System.Data;

using DAL;
using Model;

namespace BLL
{
    public  class QuestionBLL
    {
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Question model)
        {
            return QuestionDAL.Add(model);
        }

        public int Update(Question model)
        {
            return QuestionDAL.Update(model);
        }

        public DataSet GetQuestionAll()
		{
            return QuestionDAL.GetAllQuestion();
		}

        public DataSet GetQuestionByDimension(string dimId)
        {
            return QuestionDAL.GetQuestionByDimension(dimId);
        }

        public DataSet GetQuestionById(string questionId)
        {
            return QuestionDAL.GetQuestionById(questionId);
        }

        public  DataSet GetQuestionByActivityIDRand(string actid)
        {
            return QuestionDAL.GetQuestionByActivityIDRand(actid);
        }
        public DataSet GetQuestionByGUID(string guid)
        {
            return QuestionDAL.GetQuestionByGUID(guid);
        }

        public DataSet GetQuestionByGUIDRand(string guid,out int questionNum)
        {
            return QuestionDAL.GetQuestionByGUIDRand(guid,out questionNum);
        }

        public  int GetQuestionTimeByGUID(string guid, int nType)
        {
            return QuestionDAL.GetQuestionTimeByGUID(guid, nType);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public void Delete(int questionID)
        {
            QuestionDAL.Delete(questionID);
        }

        /// <summary>
        /// 删除题目表中的所有数据
        /// </summary>
        /// <returns>删除的条数</returns>
        public int DeleteAllQuestion()
        {
            return QuestionDAL.DeleteAllQuestion();
        }

        /// <summary>
        /// 删除题目表中的所有数据按维度
        /// </summary>
        /// <param name="dimID">维度ID</param>
        /// <returns>删除的条数</returns>
        public int DeleteQuestionByDim(int dimID)
        {
            return QuestionDAL.DeleteQuestionByDim(dimID);
        }

        public int UpdateQuestionStatus(string questionid, bool isDisable)
        {
            return QuestionDAL.UpdateQuestionStatus(questionid, isDisable);
        }
    }
}
